package com.taobaolite.transaction;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.sql.Time;
import java.util.List;
import java.util.Optional;

@Repository
public interface TransactionRepository extends JpaRepository<Transaction, Time> {

    @Query("from Transaction t where t.transactionId.userFrom = ?1 or t.transactionId.userTo = ?1")
    List<Transaction> findByUserId(Long userId);

}